"""
该文件用于 剪切面页面
"""
import uiautomation as auto
from page.base_page import BasePage
from utils.utils_log import loggerCase

class CuttingPlanePage(BasePage):
    """剪切面页面"""

    # 进入剪切面按钮
    __cutting_plane_button = auto.GroupControl(SubName="access_Cutting Plane")

    # 点云拟合创建剪切面
    __scan_data_fitting = auto.RadioButtonControl(SubName="Scan Data Fitting")

    # 直线创建剪切面
    __creating_straight_line = auto.RadioButtonControl(SubName="Creating straight line")

    # 标志点创建剪切面
    __markers = auto.RadioButtonControl(SubName="access_Markers")

    # 创建剪切面
    __create_plane_button = auto.GroupControl(SubName="buttonhook")

    # 删除已选择的标志点
    __delete_selected_markers = auto.GroupControl(SubName="access_Delete selected markers")

    # 删除已选择的点云-无光
    __delete_selected_point_cloud = auto.GroupControl(SubName="access_Delete selected point cloud")

    # 删除已选择的点云-激光
    __delete_the_selected_data = auto.GroupControl(SubName="access_Delete the selected data")

    # 反选区域
    __invert_button = auto.ButtonControl(SubName="Invert")

    # 重置区域
    __reset_button = auto.ButtonControl(SubName="Reset")

    # TODO 剪切面移动框
    # __cutting_edit = auto.EditControl()

    # 删除剪切面按钮
    __delete_plane = auto.ButtonControl(SubName="Delete Plane")

    def click_cutting_plane_button(self, max_wait_time=3):
        """进入剪切面"""
        loggerCase.info("进入剪切面")
        self.click(self.__cutting_plane_button, max_wait_time=max_wait_time)

    def click_creating_straight_line(self, max_wait_time=3):
        """直线创建方式"""
        loggerCase.info("直线创建剪切面")
        self.click(self.__creating_straight_line, max_wait_time=max_wait_time)

    def click_scan_data_fitting(self, max_wait_time=3):
        """点云拟合创建方式"""
        loggerCase.info("剪切面界面点击点云拟合按钮")
        self.click(self.__scan_data_fitting, max_wait_time=max_wait_time)

    def click_markers(self, max_wait_time=3):
        """标志点创建方式"""
        loggerCase.info("剪切面界面点击标志点")
        self.click(self.__markers, max_wait_time=max_wait_time)

    def click_create_plane_button(self, max_wait_time=3):
        """创建剪切面"""
        loggerCase.info("创建剪切面")
        self.click(self.__create_plane_button, max_wait_time=max_wait_time)

    def click_delete_selected_markers_button(self, max_wait_time=3):
        """删除已选择标志点"""
        loggerCase.info("点击删除已选择标志点按钮")
        self.click(self.__delete_selected_markers, max_wait_time=max_wait_time)

    def click_delete_selected_point_cloud_button(self, max_wait_time=3):
        """删除无光已选择点云"""
        loggerCase.info("点击删除无光已选择点云按钮")
        self.click(self.__delete_selected_point_cloud, max_wait_time=max_wait_time)

    def click_delete_the_selected_data_button(self, max_wait_time=3):
        """删除激光已选择点云"""
        loggerCase.info("点击删除激光已选择点云按钮")
        self.click(self.__delete_the_selected_data, max_wait_time=max_wait_time)

    def click_invert_button(self, max_wait_time=3):
        """点击反选区域"""
        loggerCase.info("点击反选区域")
        self.click(self.__invert_button, max_wait_time=max_wait_time)

    def click_reset_button(self, max_wait_time=3):
        """重置剪切面"""
        loggerCase.info("点击重置区域")
        self.click(self.__reset_button, max_wait_time=max_wait_time)

    def click_delete_plane(self, max_wait_time=3):
        """删除剪切面"""
        loggerCase.info("点击删除剪切面")
        self.click(self.__delete_plane, max_wait_time=max_wait_time)

    # def send_key_cutiing_edit(self, text):
    #     """输入剪切面移动"""
    #     loggerCase.info(f"输入剪切面移动:{text}")
    #     self.send_key(self.__cutting_edit, text=text)